/**
 * Copyright (C) 2009-2012, KingHool.com
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see http://www.gnu.org/licenses.
 */
package com.kinghool.smodel.rule;
 
/**
 * 
 * @Author Allen Deng(dengtailin@gmail.com) 
 */
public abstract class BaseModelRule implements IModelRule {
	private final int severity; 
	public BaseModelRule(int severity) {
		if (severity != SEVERITY_ERROR && 
			severity != SEVERITY_WARNING &&
			severity != SEVERITY_INFO) {
			throw new IllegalArgumentException("illegal severity code:" + severity + "!, it should be one of the values[" + 
					                            SEVERITY_ERROR + "," + 	SEVERITY_WARNING + "," + SEVERITY_INFO + "].");
		} 
		
		this.severity = severity;  
	}
	
	public int getSeverity() {
		return severity;
	} 
}
